1. Field of the Invention
The present invention relates to a method and a device for compressing image data. In particular, it relates to a method and a device for compressing image data that are obtained by a pseudo gradation process using a dither pattern.
2. Description of the Prior Art
In general, a print system including a computer and a printer is used. As such a print system, there is a type in which a computer side performs an image processing such as a pseudo gradation process on image data to be printed so that a printer side does not need to perform a special process on the image data received from the computer and prints the image on a paper sheet just by using the image data.
Conventionally, a raster printer is known as a printer that is used for this type. A raster printer does not perform any special image processing on the printer side, so it can be realized at a low cost by using a small scale of hardware. However, on the contrary, it has a disadvantage that quantity of data to be transmitted increase because image data that can be printed as they are on a paper sheet are transmitted. In addition, if the image data contain character data, it is necessary to increase resolution for printing characters sharply. As a result, quantity of data to be transmitted to the printer is further increased. For this reason, it takes much time to transmit image data from the computer to the printer.
In order to solve this problem, the computer side should compress the image data. However, if the process for compressing is complicated, the compressing process itself needs a lot of time. Furthermore, the printer side also needs a lot of time for expansion process, and a scale of hardware for the expansion process increases causing a high cost.
Therefore, in order to enable use of an inexpensive printer and to realize a print system that is capable of performing a high speed process as a whole, a compression technique is desired that can perform a compression process with a light load and the expansion process by a small scale of hardware and can realize a high compression ratio.
In order to print image data having multi gradation levels by a printer, it is necessary in many cases to perform the pseudo gradation process on the image data. As a method for the pseudo gradation process, a dithering method is known well conventionally. In the dithering method, a dither pattern is used for comparing threshold values of the dither pattern with values of pixels of the image data so as to generate binary data.
As a compression technique noting the dither pattern, there is a method disclosed in Japanese unexamined patent publication No. 6-152986. According to the method disclosed in this document, the binary image data are divided into blocks having a predetermined size. A reference pattern corresponding to the number of dots contained in an arbitrary image block is compared with the image block. If the image block matches the reference pattern, a code indicating the reference pattern is assigned. Otherwise, a result of the comparison is encoded.
In addition, as a compression technique for binary image data, JBIG method is known that is adopted by ITU (International Telecommunication Union)-T recommendation.
In addition, U.S. Pat. No. 6,201,614 discloses a method of compressing image data on which the pseudo gradation process was performed by using a dither pattern. According to the method disclosed in this document, a pixel value of each pixel is compared with a threshold value so that a range is determined for each pixel.
However, according to the method disclosed in the above-mentioned Japanese unexamined patent publication No. 6-152986, the reference pattern is encoded when a designated image block matches the reference pattern. Therefore, quantity of data to be transmitted may increase due to the code of the reference pattern.
In contrast, the JBIG method has relatively light load of the compressing process, so the compressing process can be performed at a high speed even on a computer. However, the JBIG method has a compression ratio that is not so large as other methods such as the LZS method or the LZW method. In particular, if halftone data increase, the compression ratio will be decreased.
In addition, a value is determined for each pixel in the method disclosed in the above-mentioned U.S. Pat. No. 6,201,614, so quantity of information is not decreased only by itself. Therefore, it is necessary to use other means for compressing the data in order to reduce the quantity of information.
As to these issues, the applicant proposed formerly a method and a device for compressing image data on which the pseudo gradation process was performed by using a dither pattern, at a high speed with a high compression ratio, and the compressed data can be reconstructed by using a small scale of hardware.